program PointsOfIntersection;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, i, j: Integer;
  mass1, massa, massb, massb, massdx, massdy: array of Integer;
  fin: TextFile;

begin
  AssignFile(fin, 'input.txt.');
  Reset(fin);
  Readln(fin, n);
  SetLength(mass, 4*n);
  for i:=0 to 4*n-1 do
    read (fin, mass[i]);
  SetLength (massa, 2*n);
  SetLength (massb, 2*n);
  SetLength (massc, 2*n);
  SetLength (massdx, n);
  SetLength (massdy, n);
  for i:=0 to n-1 do
  begin
    massdx[i]:=mass[i]-mass[i+2];
    massdy[i]:=mass[i+1]-mass[i+3];
    D:=Sqrt(massdx[i]*massdx[i]+massdy[i]*massdy[i]-R*R);
    massa[i]:=(-R*massdx[i]-massdy[i]*D)/(massdx[i]*massdx[i]+massdy[i]*massdy[i]);
    massa[i+1]:=(-R*massdx[i]+massdy[i]*D)/(massdx[i]*massdx[i]+massdy[i]*massdy[i]);
    massb[i]:=(-R*massdy[i]+massdx[i]*D)/(massdx[i]*massdx[i]+massdy[i]*massdy[i]);
    massb[i+1]:=(-R*massdy[i]-massdx[i]*D)/(massdx[i]*massdx[i]+massdy[i]*massdy[i]);
    massc[i]:=-massa[i]*x0-massb[i]*y0;
    massc[i+1]:=-massa[i+1]*x0-massb[i+1]*y0;
  end;
  CloseFile(fin);
end.
